#include <QtGui>

#include "gameoverscreen_frame.h"
#include "invader_label.h"

GameOverScreen::GameOverScreen (QWidget *parent)
  : QFrame (parent)
{
  setFocusPolicy (Qt::ClickFocus);

  QVBoxLayout *layout = new QVBoxLayout;

  layout->addWidget (new InvaderLabel ("game over", this),
                     0, Qt::AlignHCenter);
  layout->addWidget (new InvaderLabel ("press enter to continue", this),
                     0, Qt::AlignHCenter);

  setLayout (layout);
}

void GameOverScreen::keyPressEvent (QKeyEvent *event)
{
  switch (event->key ()) {
    case Qt::Key_Return:
    case Qt::Key_Enter:
      emit hideScreen ();
      break;

    default:
      break;
  }
}
